package com.tokenplus.thai.extend

import android.annotation.SuppressLint
import java.text.SimpleDateFormat
import java.util.*

@SuppressLint("SimpleDateFormat")
fun Date.dateFormatString(targetFormat: String): String? {
    try {
        val sDateFormat = SimpleDateFormat(targetFormat)
        val sdateFormatString = sDateFormat.format(this)
        return sdateFormatString
    } catch (e: Exception) {
        e.printStackTrace()
    }
    return null
}
